package com.Jano.mapper;


import com.Jano.model.PermissionModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * description: PermissionMapper <br>
 * date: 2022/7/10 11:21 PM <br>
 * author: zoumaoji <br>
 * version: 1.0 <br>
 */

@Mapper
public interface PermissionMapper {
    /**
     * 根据用户名查找其权限
     * @param userName
     * @return
     */
    @Select("select id, funccode, funcname, funcurl, parentid, createtime, createby from au_permission\n" +
            "where id in (select permissionId from au_role_permission where roleId =(select roleId from au_user where username=#{userName}))")
    List<PermissionModel> findPermissionsByUserName(String userName);
}
